-
Notifications
You must be signed in to change notification settings - Fork 41
RDKB-63166 : Update device.properties file during runtime #186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reason for change : Modify device.properties file based on partner ID Test Procedure : Check that /etc/device.properties contains "IS_BCI=yes" Risks : Low Priority: Medium Signed-off-by: abhishek_kumaracee2@comcast.com
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds ONESTACK-specific logic to update /etc/device.properties at runtime based on the resolved PartnerID, ensuring IS_BCI=yes is present for Comcast Business devices.
Changes:
- Introduced
addPartnerDefaultsToDevPropFile()to appendIS_BCI=yesinto/etc/device.propertieswhen available. - Hooked the new helper into
main()so that, underONESTACK_PRODUCT_REQ, ifPartnerIDiscomcast-business, the device properties file is updated after partner defaults are applied.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| int i = 0; | ||
| for (i = 0; g_dev_prop_params[i] != NULL; i++) | ||
| { | ||
| if (fprintf(fp, "%s\n", g_dev_prop_params[i]) < 0) | ||
| { |
Copilot
AI
Jan 25, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addPartnerDefaultsToDevPropFile always appends IS_BCI=yes to /etc/device.properties on each run without checking whether the key already exists, which will cause duplicate entries to accumulate over time. To keep device.properties clean and the operation idempotent, consider first checking if IS_BCI is already present (e.g., by scanning the file or reusing existing helper logic) and only appending when the key is missing.
| //check file for existence | ||
| if (access(DEV_PROP_FILE, F_OK) != 0) | ||
| { | ||
| APPLY_PRINT("[Utopia - %s]File %s does not exists\n",__FUNCTION__,DEV_PROP_FILE); |
Copilot
AI
Jan 25, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Log message text "File %s does not exists" is grammatically incorrect; it should be "does not exist". Please fix the wording in this message to avoid shipping a user-visible typo.
| APPLY_PRINT("[Utopia - %s]File %s does not exists\n",__FUNCTION__,DEV_PROP_FILE); | |
| APPLY_PRINT("[Utopia - %s]File %s does not exist\n",__FUNCTION__,DEV_PROP_FILE); |
| #if defined (ONESTACK_PRODUCT_REQ) | ||
| if (0 == strcasecmp (PartnerID, "comcast-business")) | ||
| { | ||
| if ( 1 == addPartnerDefaultsToDevPropFile()) | ||
| { | ||
| APPLY_PRINT("%s - Failed to write default props to '%s'\n", __FUNCTION__, DEV_PROP_FILE); |
Copilot
AI
Jan 25, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new ONESTACK-specific behavior that updates /etc/device.properties based on the PartnerID (via addPartnerDefaultsToDevPropFile when PartnerID is "comcast-business") is not covered by the existing apply_system_defaults unit tests, even though this component already has a gtest suite. Consider adding unit tests (e.g., under source/test/apply_system_defaults) that exercise this path and validate that IS_BCI is written to the properties file when the appropriate partner ID is set, and that failures are logged correctly.
Reason for change : Modify device.properties file based on partner ID
Test Procedure : Check that /etc/device.properties contains "IS_BCI=yes"
Risks : Low
Priority: Medium
Signed-off-by: abhishek_kumaracee2@comcast.com